package com.atguigu.gmall.product.rpc;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.product.service.BaseCategory1Service;
import com.atguigu.gmall.weball.CategoryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName getCategoryTreeData
 * @Description TODO
 * @Author king
 * @Date 2022/11/3 17:34
 * @Version 1.0
 */
@RestController
@RequestMapping("/api/inner/rpc/product")
public class getCategoryTreeData {

    @Autowired
    BaseCategory1Service baseCategory1Service;

    @GetMapping("/category/tree")
    public Result getCategoryTreeData(){
        List<CategoryVO> vos = baseCategory1Service.getCategoryTreeData();
        return Result.ok(vos);
    }

}
